package com.apes.fa.report;

import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface FaAssetDepreciationRepository extends CustomRepository<FaAssetDepreciation,String> {

    @Query(value = "SELECT * FROM fa_asset_depreciation t WHERE " +
            "t.company_id = :companyId and t.cost_center_id = :costCenterId and " +
            "t.fa_category_id = :faCategoryId and to_char(t.finance_date, 'yyyyMM') = :yearMonth", nativeQuery = true)
    List<FaAssetDepreciation> findByCompanyIdAndCostCenterIdAndFaCategoryId(String companyId, String costCenterId, String faCategoryId,String yearMonth);

}
